﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace HelloComponents {
    /// <summary>
    /// 组件UI界面应派生自PluginFormBase
    /// </summary>
    public partial class HelloConnectionForm : LoongCAD.STC.Friendly.Dialog.PluginFormBase {
        public HelloConnectionForm() {
            InitializeComponent();
        }

        /// <summary>
        /// 确定按钮点击事件
        /// </summary>
        private void okApplyModifyGetOnOffCancel1_OkClicked(object sender, EventArgs e) {
            this.Apply();
            this.Close();
        }

        /// <summary>
        /// 应用按钮点击事件
        /// </summary>
        private void okApplyModifyGetOnOffCancel1_ApplyClicked(object sender, EventArgs e) {
            this.Apply();
        }

        /// <summary>
        /// 修改按钮点击事件
        /// </summary>
        private void okApplyModifyGetOnOffCancel1_ModifyClicked(object sender, EventArgs e) {
            this.Modify();
        }

        /// <summary>
        /// 获取按钮点击事件
        /// </summary>
        private void okApplyModifyGetOnOffCancel1_GetClicked(object sender, EventArgs e) {
            this.Get();
        }

        /// <summary>
        /// 筛选开关按钮点击事件
        /// </summary>
        private void okApplyModifyGetOnOffCancel1_OnOffClicked(object sender, EventArgs e) {
            this.ToggleSelection();
        }


        /// <summary>
        /// 取消按钮点击事件
        /// </summary>
        private void okApplyModifyGetOnOffCancel1_CancelClicked(object sender, EventArgs e) {
            this.Close();
        }

        /// <summary>
        /// 输入框Enter按键事件
        /// </summary>
        private void OnTextBoxDown(object sender, KeyEventArgs e) {
            if (e.KeyCode.HasFlag(Keys.Enter)) {
                this.Modify();
            }
        }
    }
}
